﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Utilities;

namespace MaHoaUngDung
{
    public partial class DoiMatKhauFrm : DevComponents.DotNetBar.Office2007Form
    {
        public DoiMatKhauFrm()
        {
            InitializeComponent();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            if (Program.ListUser.CheckUser(Program.CurrentUser.Email, tbOldPass.Text.Trim()))
            {
                Program.CurrentUser.UpdatePassphrase(tbNewPass.Text.Trim());
                MessageBox.Show("Cập nhật passphrase thành công!.", Utility.InformTitle);
            }
            else
            {
                MessageBox.Show("passphrase sai!.", Utility.InformTitle);
            }
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
